package test.parties;

import java.util.HashSet;
import java.util.List;
import java.util.Random;

import ontology.VOBeanOntology;
import ontology.VOOntology;
import ontology.concepts.vo.Antecedent;
import ontology.concepts.vo.Consequent;
import ontology.concepts.vo.Situation;
import ontology.concepts.vo.VOAction;
import ontology.concepts.vo.VOCase;
import ontology.concepts.vo.VONorm;
import ontology.concepts.vo.VOObligation;
import utils.DBUtils;

public class RandomIntegers {

	 public static final void main(String... aArgs){
		 VONorm norm1 = new VONorm();
			norm1.setContract_type("supply-agreement");
			norm1.setName("norm1");
				Antecedent a1 = new Antecedent();
				HashSet<Situation> situationSet1 = new HashSet<Situation>();
					Situation s1 = new Situation();
					s1.setType("fact");
						VOAction act1 = new VOAction();
						act1.setName("order");
						act1.setSender("A");
						act1.setReceiver("B");
						act1.setArgs("Produto = P; Qtd < 10");
					s1.setContractId("c_1");
					s1.setVoaction(act1);
					s1.setWhen("W");
				situationSet1.add(s1);			
				a1.setSituation(situationSet1);
			norm1.setAntecedent(a1);
				Consequent c1 = new Consequent();
				HashSet<VOObligation> obligationSet1 = new HashSet<VOObligation>();
					VOObligation obl1 = new VOObligation();
					obl1.setDeadline("W + 10");
					obl1.setLiveline("W + 5");
					obl1.setNormName("norm1");
					obl1.setContractId("c_1");
						VOAction act2 = new VOAction();
						act2.setName("deliver");
						act2.setSender("B");
						act2.setReceiver("A");
						act2.setWhenHappened("W");
						act2.setArgs("Produto = P; Qtd = X");
					obl1.setVoaction(act2);
				obligationSet1.add(obl1);
				c1.setPrescription(obligationSet1);
			norm1.setConsequent(c1);
			
		 List<VOCase> cases = DBUtils.getVOCasesByNormAction(act1.getName());
		 if(cases!=null){
			 System.out.println("Retornou");
		 }
		 else{
			 System.out.println("A coisa esta nula");
		 }
	 }
}
